import { configureStore } from '@reduxjs/toolkit'
import rootReducer from './rootReducer'

const store = configureStore({
  reducer: rootReducer,
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: false, // 可选：关闭序列化检查（如果需要非序列化状态）
    }),
  devTools: process.env.NODE_ENV !== 'production', // 开发环境启用 Redux DevTools
})

export default store

// // 导出类型用于 hooks
// export type AppDispatch = typeof store.dispatch
